package it.univaq.mwt.common.business;

import it.univaq.mwt.business.FilesService;

public abstract class FilesServiceFactory {

	private static FilesServiceFactory instance;
	
	public abstract FilesService getFilesService();
	

	protected FilesServiceFactory() {
	}
	
	public synchronized static FilesServiceFactory getInstance() {
		if (instance==null) {
			throw new RuntimeException();
		}
		return instance;
	}
	

	public synchronized static void setInstance(FilesServiceFactory factory) {
		if (instance!=null) {
			throw new RuntimeException();
		}
		instance = factory;
		
	}

}
